home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / general / procssng / ccs / ccs-11.lha / ccs-lib / include / getx11.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-20  |  3.7 KB  |  147 lines

  1. /*
  2. % This software is copyrighted as noted below.  It may be freely copied,
  3. % modified, and redistributed, provided that the copyright notices are
  4. % preserved on all copies.
  5. %
  6. % There is no warranty or other guarantee of fitness for this software,
  7. % it is provided solely "as is".  Bug reports or fixes may be sent
  8. % to the author, who may or may not act on them as he desires.
  9. %
  10. % You may not include this software in a program or other software product
  11. % without supplying the source, or without informing the end-user that the
  12. % source is available for no extra charge.
  13. %
  14. % If you modify this software, you should include a notice giving the
  15. % name of the person performing the modification, the date of modification,
  16. % and the reason for such modification.
  17. %
  18. % getx11.h - Declaration for image_information structure...
  19. %
  20. % Author:    Martin R. Friedmann
  21. %        Dept of Electrical Engineering and Computer Science
  22. %        University of Michigan
  23. % Date:    Tue, Dec 10, 1989
  24. % Copyright (c) 1989,    University of Michigan
  25. %
  26. % Modified:    Jin, Guojun -    ITG,    LBL
  27. % Date: Mon, Oct 1, 1990
  28. % Copyright (c)    1990,    Lawrence Berkeley Laboratory
  29. */
  30.  
  31. #if    !defined PANEL_H & defined X_WINDOW_DEP
  32. #    include <stdio.h>
  33. #    include <math.h>
  34. #    include <ctype.h>
  35. #    include <X11/X.h>
  36. #    include <X11/Xlib.h>
  37. #    include <X11/Xutil.h>
  38. #    include <X11/cursorfont.h>
  39. #endif
  40. #include "rle.h"
  41.  
  42. #define COUNT_OF(_array_)    (sizeof(_array_) / sizeof(_array_[0]))
  43. #define IMAGE_BORDERWIDTH    3
  44.  
  45. #ifdef USE_STDLIB_H
  46. #include <stdlib.h>
  47. #else
  48.  
  49. #ifdef USE_STRING_H
  50. #include <string.h>
  51. #else
  52. #include <strings.h>
  53. #endif
  54. extern char    *getenv();
  55. extern void    *malloc(), *realloc(), free();
  56.  
  57. #endif    USE_STDLIB_H
  58.  
  59. typedef unsigned int    Pixel;
  60. typedef void    VOID_FUNCTION();
  61. typedef int    array16[16];
  62.  
  63. #define MALLOC_FAILURE    3
  64. #define FILE_FAILURE    2
  65. #define FATAL_FAILURE    1
  66. #define SUCCESS        0
  67.  
  68. #define VPRINTF if (verbose)    fprintf
  69. #define DPRINTF if (debug)    fprintf
  70.  
  71. #define SHIFT_MASK_PIXEL(r, g, b)    \
  72.     ( (((r) << red_shift) & red_mask)    \
  73.     | ( ((g) << green_shift) & green_mask )    \
  74.     | ( ((b) << blue_shift) & blue_mask ) )
  75.  
  76. #define SHIFT_MASK_PIXEL_32(r, g, b)    \
  77.     ( ((r) << red_shift) | ((g) << green_shift) | ((b) << blue_shift) )
  78.  
  79. #ifndef    HIPS2_HF
  80. typedef    int    Boolean;
  81. #endif
  82.  
  83. extern double    display_gamma;
  84. extern bool    jump_flag, load_frame, multi_frame, tuner_flag, rw_set,
  85.         debug,        /* set    if debug mode -D    */
  86.         verbose;    /*    -v    */
  87. extern int     iflag, screen, stingy_flag, specified_levels;
  88.  
  89. #if    defined    HIPS2_HF | defined HIPS_IMAGE
  90. extern    char    *Progname;
  91. #define    progname Progname
  92. #else
  93. extern    char*    progname;
  94. #endif
  95.  
  96. /*    X11/NeWS server bug workaround    */
  97. extern int    no_color_ref_counts;
  98.  
  99. /*    Color map, gamma correction map, & lookup tables    */
  100.  
  101. extern int    red_shift, green_shift, blue_shift;
  102. extern Pixel    red_mask, green_mask, blue_mask, pixel_base;
  103.  
  104. /*    pointer arithmetic. Returns Y'th row in our saved data array.    */
  105.  
  106. #ifndef    SAVED_RLE_ROW
  107.  
  108. #ifndef    GETX_OFFSET
  109. #define    GETX_OFFSET    0
  110. #endif
  111. #define SAVED_RLE_ROW(img, y)    \
  112.     (((Image*)img)->scan_data +    \
  113.     (((y) + GETX_OFFSET) * ((Image*)img)->width * (img)->dpy_channels))
  114. #define ORIG_RLE_ROW(img, y)    \
  115.     (((Image*)img)->data +    \
  116.     (((y) + GETX_OFFSET) * ((Image*)img)->width * (img)->dpy_channels))
  117. #endif
  118.  
  119. #define duff8(counter, block) {    \
  120.     while (counter >= 8) {    \
  121.     { block; }    \
  122.     { block; }    \
  123.     { block; }    \
  124.     { block; }    \
  125.     { block; }    \
  126.     { block; }    \
  127.     { block; }    \
  128.     { block; }    \
  129.     counter -= 8;    \
  130.     } \
  131.     switch (counter & 7) {    \
  132.     case 7:    { block; }    \
  133.     case 6:    { block; }    \
  134.     case 5:    { block; }    \
  135.     case 4:    { block; }    \
  136.     case 3:    { block; }    \
  137.     case 2:    { block; }    \
  138.     case 1:    { block; }    \
  139.     case 0:    counter = 0;    \
  140.      }\
  141. }
  142.  
  143. #define    UnmapPixWindow(img)    XUnmapWindow (img->dpy, img->pix_info_window)
  144.  
  145. #define DESIRED_ICON_WIDTH    128
  146. #define DESIRED_ICON_HEIGHT    96
  147.